GBML manual / Audio

sound_gain

A GLOBAL volume multiplier (0..1), applied to every sound_play() from here on - a project’s own "sound effects volume" setting.

Syntax

sound_gain(gain)

Arguments

NameType
gainreal

Returns

Nothing.

Description

A global volume multiplier (0..1), applied to every sound_play from here on - a project's own "sound effects volume" setting, typically set once from an options screen rather than called constantly. This is not live per-sound volume control: the hardware has no volume knob for a sound already in flight (only music has one), so there is nothing this could apply retroactively to a sound already playing when it is called.

Example

sound_gain(0.5);

Halves the volume of every sound effect played from here on, without touching anything already in flight.

On the GBA

NOT live per-sound volume control: the hardware has no volume knob for a sound already in flight (only music has one), so there is nothing this could apply retroactively to a sound already playing.

See also: sound_play